#!/usr/bin/env python3
import os
import subprocess

from environs import Env


if __name__ == "__main__":
  env = Env()

  __location__ = os.path.realpath(
      os.path.join(os.getcwd(), os.path.dirname(__file__))
  )

  env.read_env(os.path.join(__location__, ".env"))

  user=env.str("DEPLOY_USER")
  host=env.str("DEPLOY_HOST")
  path=env.str("DEPLOY_PATH")

  command = f"{__location__}/deploy.sh --host {host} --user {user} --remote-dir {path}"

  subprocess.run(command, shell=True)
